package com.milk.controller.user;


import com.milk.entity.UserSignIn;
import com.milk.result.Result;
import com.milk.service.IUserSignInService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/signIn")
@ApiModel(value = "用户签到表")
public class UserSignInController {
    @Autowired
    private IUserSignInService userSignInService;


    /**
     * 用户签到天数
     * @return
     */
    @GetMapping
    @ApiModelProperty("用户签到天数")
    public Result<Integer> signInDay(){
        Integer day = userSignInService.signInDay();
        return Result.success(day);
    }

    /**
     * 用户点击签到
     * @return
     */
    @PutMapping
    @ApiModelProperty("用户点击签到")
    public Result<String > signIn(){
        String mgs = userSignInService.signIn();

        return Result.success(mgs);
    }
}
